module(..., package.seeall)

local imgPath = "images/"
function displayLevelBar()
	 -- level bar
	local myRectangleInner = display.newRect(11, 51, 35, 4)
	myRectangleInner.strokeWidth = 0
	myRectangleInner:setFillColor(255, 255, 0)
	myRectangleInner:setStrokeColor(0, 222, 222)

	local myRectangle = display.newRect(10, 50, 50, 6)
	myRectangle.strokeWidth = 1.5
	myRectangle:setFillColor(255, 0 , 0)
	myRectangle:setStrokeColor(0, 0, 0)

	 -- coin
	local imgCoin = display.newImage( imgPath .. "coin.png" )
	imgCoin.x = 20
	imgCoin.y = 68
	
	local coin_count = 0
	local user_level = 0
	
	--print all the table contents from db
	for row in db:nrows("SELECT * FROM data") do
	  local text = row._id.." "..row.coin_count
	  coin_count = row.coin_count
	  user_level = row.user_level
	  --local t = display.newText(coin_count, 200, 30 * row._id, null, 16)
	  --t:setTextColor(255,0,0)
	end
	 -- coin text
	local txtCoin = display.newText( coin_count, 35, 62, native.systemFontBold, 11 )
	 --level text
	local level   = display.newText( "LV. " .. user_level, 10, 35, native.systemFontBold, 13 )

end
